package com.jy.wms.web;

import com.joyi.gate.comm.SessionInfo;
import com.joyi.gate.safety.vo.UserInfo;
import com.jy.wms.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * Created by syh on 2018/8/3.
 */
@Controller
@RequestMapping("/ownerRouter")
public class WmsOwnerRouter {
    @Autowired
    SysMenuService menuService;
    /**
     * 跳转查询列表页
     * @param model
     * @param menu
     * @return
     */
    @RequestMapping(value = "getOwnerList/{menu}")
    public String getOwnerList(@PathVariable("menu") String menu, Model model){
        model.addAttribute("functions",menuService.getFunctions(menu));
        return  "business/wmsOwner/wmsOwnerList";
    }
    /**
     * 跳转货主详情页面
     * @param id
     * @param model
     * @return
     */
    @RequestMapping(value = "/getFindHz")
    public String getFindHz(String id, Model model) {
        model.addAttribute("id",id);
        return "business/wmsOwner/wmsOwnerXiangxi";
    }
    /**
     * 跳转新增生成页面
     * @return
     */
    @RequestMapping(value = "toAddowner")
    public String toAddowner(){
        return  "business/wmsOwner/addWmsOwner";
    }

    /**
     * 调编辑页面
     * @param id
     * @param model
     * @return
     */
    @RequestMapping(value = "toEditOwner")
    public String toEditgroup(String id,Model model){
        model.addAttribute("id",id);
        return  "business/wmsOwner/editWmsOwner";
    }

    /**
     * 跳配置订单页面
     * @param id
     * @param model
     * @return
     */
    @RequestMapping(value = "toPeizhiOwner")
    public String toPeizhiOwner(String id,String mc,Model model){
        model.addAttribute("id",id);
        model.addAttribute("mc",mc);
        return  "business/wmsOwner/peizhiWmsOwner";
    }

    /**
     * 跳集货暂存库位
     * @param id
     * @param model
     * @return
     */
    @RequestMapping(value = "toGetAllKw")
    public String toGetAllKw(String id,String mc,Model model){
        model.addAttribute("id",id);
        model.addAttribute("mc",mc);
        return  "business/wmsOwner/zjKwWmsOwner";
    }
    /**
     * 编辑库位
     * @param id
     * @param model
     * @return
     */
    @RequestMapping(value = "toEditLocation")
    public String toEditLocation(String id,Model model){
        model.addAttribute("id",id);
        //return  "business/wmsOwner/EditLocation";
        return  "business/wmsOwner/setLocation";
    }
}